home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_sol_greengem.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  124 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SOL_GreenGem.cog
  4. #
  5. # [TRM]
  6. #
  7. # GemA = 95
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.     message     startup
  16.     message     user0
  17.     message     activated
  18.     
  19.     thing       player      local
  20.     thing       gem
  21.     thing       gemCam
  22.     thing       camPos
  23.     
  24.     sound       snd_Gem1=Inxj193.wav    local   # First gem: One of King Sol's jewels.
  25.     sound       snd_Gem2=Inxj194.wav    local   # Second gem: Another Jewel...
  26.     sound       snd_Gem3=Inxj195.wav    local   # Third gem: A third gem...
  27.     
  28.     cog         blueGem
  29.     cog         redGem
  30.     cog         talkCog             local
  31.     
  32.     int         gemsFound=0         local
  33.     int         gotIt=0             local
  34.     int         curCam              local
  35.     
  36. end
  37.  
  38. # ========================================================================================
  39.  
  40. code
  41.  
  42. startup:
  43.  
  44.     SetThingLight(gem, '0.3 0.8 0.3', 0.01, 0.1);
  45.     return;
  46.  
  47. # ========================================================================================
  48.  
  49. user0:
  50.  
  51.     gemsFound = gemsFound + 1;
  52.     return;
  53.     
  54. # ========================================================================================
  55.  
  56. activated:
  57.  
  58.     player = GetLocalPlayerThing();
  59.     curCam = GetCurrentCamera();
  60.  
  61.     if((GetSenderRef() == gem) && (gotIt == 0))
  62.     {
  63.         gotIt = 1;
  64.         StartCutscene(1);
  65.         
  66.         # increase gemsFound in the other cogs
  67.         SendMessage(blueGem, user0);
  68.         SendMessage(redGem, user0);
  69.         
  70.         # disable player
  71.         StopThing(player);
  72.         SetActorFlags(player, 0x200000);
  73.         
  74.         # switch to gemCam
  75.         SetCameraFocus(2, gemCam);
  76.         SetCameraSecondaryFocus(2, player);
  77.         SetCurrentCamera(2);
  78.         SetCameraFOV(90, 0, 0.0);
  79.         
  80.         Sleep(0.5);
  81.         
  82.         # Call the Pickup Lines cog
  83.         talkCog = GetCogByIndex(0);
  84.         SendMessage(talkCog, 27);
  85.         
  86.         # sleep to wait for talkCog
  87.         Sleep(1.0);
  88.         
  89.         # play dialog as gems spins into inventory
  90.         if(gemsFound == 0)
  91.         {
  92.             PlayVoice(player, snd_Gem1, 1.0, 1);
  93.         }
  94.         
  95.         else if(gemsFound == 1)
  96.         {
  97.             PlayVoice(player, snd_Gem2, 1.0, 1);
  98.         }
  99.         
  100.         else if(gemsFound == 2)
  101.         {
  102.             PlayVoice(player, snd_Gem3, 1.0, 1);
  103.         }
  104.         
  105.         # increase gemsFound in this cog
  106.         gemsFound = gemsFound + 1;
  107.         
  108.         # restore controls
  109.         ClearActorFlags(player, 0x200000);
  110.         
  111.         # return camera to player
  112.         SetCameraPosition(curCam, GetThingPos(camPos));
  113.         SetCurrentCamera(curCam);
  114.         
  115.         EndCutscene();
  116.     }
  117.  
  118.     return;
  119.             
  120. # ========================================================================================
  121.         
  122. end
  123.  
  124.